import fetch from 'utils/fetch';
/**
 * 考勤设备
 */
//分页查询学校设备
export function pageDevice(page,rows,fSchoolId,sPosition,sNumber) {
    const data = {
        fSchoolId,
        sPosition,
        sNumber
    };
    return fetch({
        url: `device/pageDevice/${page}/${rows}`,
        method: 'post',
        data,
    });
}
//查看设备详情
export function getDeviceInfo(pId) {
    return fetch({
        url: `device/getDeviceInfo/${pId}`,
        method: 'post',
    });
}
//查询考勤设置时间
export function listAttendanceTime(fSchoolId) {
    const data = {
        fSchoolId
    };
    return fetch({
        url: 'device/listAttendanceTime',
        method: 'post',
        data,
    });
}
//设置考勤时间
export function updateAttendanceTime(fSchoolId,studentFirstStartTime,studentFirstEndTime,studentSecondStartTime,studentSecondEndTime,
    studentThirdStartTime,studentThirdEndTime,teacherFirstStartTime,teacherFirstEndTime,teacherSecondStartTime,teacherSecondEndTime,teacherThirdStartTime,teacherThirdEndTime) {
    const data = {
        fSchoolId,
        studentFirstStartTime,
        studentFirstEndTime,
        studentSecondStartTime,
        studentSecondEndTime,
        studentThirdStartTime,
        studentThirdEndTime,
        teacherFirstStartTime,
        teacherFirstEndTime,
        teacherSecondStartTime,
        teacherSecondEndTime,
        teacherThirdStartTime,
        teacherThirdEndTime
    };
    return fetch({
        url: 'device/updateAttendanceTime',
        method: 'post',
        data,
    });
}

//查询推送时间
export function listCronExpress(schoolId) {
    const data = {
        schoolId
    };
    return fetch({
        url: 'device/listCronExpress',
        method: 'post',
        data,
    });
}

//查询异常推送开启或关闭
export function listExceptionPush(schoolId) {
    const data = {
        schoolId
    };
    return fetch({
        url: 'device/listExceptionPush',
        method: 'post',
        data,
    });
}

//异常推送设置
export function updateExceptionPush(schoolId,status,cron,cronDesc) {
    const data = {
        schoolId,
        status,
        cron,
        cronDesc
    };
    return fetch({
        url: 'device/updateExceptionPush',
        method: 'post',
        data,
    });
}